<?php
class Covers extends Public_Controller
{
	function __construct()
	{
		parent::__construct();
	}
	
	function index()
	{
		$data['cover'] = new Cover();
		$data['cover']->where("start_date <= date(sysdate()) and (end_date >= date(sysdate()) or end_date = date('0000-00-00')) and status = 'approve'");
		$data['cover']->order_by('id','desc')->get(10);
		if($data['cover']->exists())
		{
			$this->template->set_layout('cover');
			$this->template->build('cover_index',$data);
		}
		else
		{
			redirect('home');
		}
	}
	
	
}
?>